package com.XDApp.xdbase.view.handleimage;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.View.OnClickListener;

public class StandardImageProgrammaticWithOnClick extends
		StandardImageProgrammatic {

	private Handler handler = new Handler() {
		public void handleMessage(android.os.Message msg) {
			switch(msg.what){
			case 11:
				llBottom.setVisibility(View.VISIBLE);
				handler.sendEmptyMessageDelayed(10, 2000);
				break;
			case 10:
				llBottom.setVisibility(View.INVISIBLE);
				break;
			}
		};
	};

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		view.setClickable(true);
		view.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				// new AlertDialog.Builder(v.getContext())
				// .setMessage("Clicked!")
				// .setTitle("onClickTest")
				// .setPositiveButton("OK", new
				// DialogInterface.OnClickListener() {
				// @Override
				// public void onClick(DialogInterface dialog, int which) {
				// dialog.dismiss();
				// }
				// })
				// .create().show();
				
				handler.sendEmptyMessage(11);
			}
		});
	}
}